<?php
/**
 * Project: AIGC
 * Author: moufer <moufer@163.com>
 * Date: 2024/9/18 17:27
 */

namespace module\user\controller;

use module\user\library\UserController;
use module\user\logic\InviteLogic;
use mof\ApiResponse;
use mof\Searcher;
use think\response\Json;

class Invite extends UserController
{
    public function logs(InviteLogic $logic): Json
    {
        $searcher = (new Searcher())
            ->with(['invitee'])
            ->params(['inviter_id' => $this->auth->getId()])
            ->order(['create_at' => 'desc'])
            ->pageSize(100);

        return ApiResponse::success($logic->paginate($searcher, true));
    }
}